import {Component, OnInit} from '@angular/core';
import {BladeService} from '../../../shared/blade.service';
import {Blade} from '../../../shared/blade/blade.model';
import {BladeData} from '../../../shared/blade/blade-data';
import {Observable} from 'rxjs/Observable';
import {FaultLevelListComponent} from './fault-level-list/fault-level-list.component';

@Component({
  selector: 'app-fault-level-config',
  templateUrl: './fault-level-config.component.html',
  styleUrls: ['./fault-level-config.component.css'],
  providers: [BladeService]
})
export class FaultLevelConfigComponent implements OnInit {

  /**
   * 当前弹出层
   *
   * @type {Blade}
   * @memberof FaultLevelConfigComponent
   */
  currentBlade: Blade;

  constructor(
    public bladeService: BladeService,
  ) {
  }

  ngOnInit() {
    this.createUserListBlade()
  }

  /**
   * 创建用户列表弹出层
   *
   * @memberof FaultLevelConfigComponent
   */
  createUserListBlade() {
    let data: BladeData = new BladeData();
    data.id = ' FaultLevelList';
    data.title = '报警级别设置';
    // data.subtitle = "报警级别设置"; //副标题
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(FaultLevelListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }

  /**
   * 是否可以离开
   *
   * @returns {(boolean | Observable<boolean> | Promise<boolean>)}
   * @memberof FaultLevelConfigComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/fault-level-config/fault-level-config.component.ts
